import { createApp } from 'vue'
import ECharts from 'vue-echarts'
import 'echarts'
import { createPinia } from 'pinia'
import App from './App.vue'
import router from './router'
import './style.css'
import { use } from 'echarts/core'
import { CanvasRenderer } from 'echarts/renderers'
import { LineChart } from 'echarts/charts'
import {
  GridComponent,
  TooltipComponent,
  TitleComponent
} from 'echarts/components'

// 手动注册必要的ECharts组件
use([
  CanvasRenderer,
  LineChart,
  GridComponent,
  TooltipComponent,
  TitleComponent
])

const app = createApp(App)

app.component('v-chart', ECharts)
app.use(createPinia())
app.use(router)

app.mount('#app')
